﻿Ext.override(NExt.UI.Find.Data.GridFindPresenter, {
    setDataSource: function(dataSource) {
        this.browsePresenter.store.loadData(dataSource);
    },

    setCurrentModel: function(current) {
        if (!current) {
            return;
        }

        var currentRecord;
        this.browsePresenter.store.each(function(record) {
            if (record.json == current) {
                currentRecord = record;
                return false;
            }
        });

        var selectionModel = this.browsePresenter.gridPanel.getSelectionModel();
        selectionModel.selectRecords.defer(200, selectionModel, [[currentRecord]]);
    }
});
